home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 18 / AMIGAplus Sonderheft 18 (1999)(ICP)(DE)[!].iso / PD / Spiele / InvasionForce / Source / Misc / AddCommas.rexx next >
OS/2 REXX Batch file  |  1999-01-08  |  515b  |  24 lines

  1.  
  2. /* AddCommas.rexx - add a comma to each line of a text file */
  3.  
  4. parse arg filename
  5. if ~open('infile',filename,'r') then do
  6.         say "Sorry, can't read" filename "."
  7.         exit
  8. end
  9. call open('outfile',"T:OUTPUT",'w')
  10. line=readln('infile')
  11. do while ~eof('infile')
  12.         line=line","
  13.         call writeln('outfile',line)
  14.         line=readln('infile')
  15. end
  16. call close('infile')
  17. call close('outfile')
  18.  
  19. address command "copy T:OUTPUT to" filename
  20. address command "delete >nil: T:OUTPUT"
  21.  
  22. exit
  23. /* end of listing */
  24.